<template>
	<view class="background">
		<view class="content">

			<view class="icon">
				<uni-icons @click="close" type="close" color="#fff" size="20"></uni-icons>
			</view>

			<view class="cont">
				<image :show-menu-by-longpress="true" class="img" src="/static/newImg/wx.jpg">
				</image>
			</view>
			<view class="title">
				长按<text class="tl">扫一扫</text>添加我们微信
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods: {
			previewImage() {
				uni.previewImage({
					// 需要预览的图片链接列表。若无需预览，可以注释urls
					// urls: [e.target.src],
					// 为当前显示图片的链接/索引值
					current: e.target.src,
					// 图片指示器样式	
					indicator: 'default',
					// 是否可循环预览
					loop: false,
					success: res => {
						console.log('previewImage res', res);
					},
					fail: err => {
						console.log('previewImage err', err);
					}
				});
			},
			close() {
				this.$emit('closeOpinionShow')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.background {
		// z-index 控制是全屏还是半屏，即是否占顶部导航栏的位置
		z-index: 9999;
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		// 遮罩颜色
		background: rgba($color: #000000, $alpha: 0.5);

		.content {
			width: 250px;
			// height: 280px;
			background-color: #fff;
			border-radius: 14px;
			padding: 10px;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			position: relative;

			.icon {
				position: absolute;
				top: -10%;
				right: -5%;
				color: #fff;
				// border: 1px solid #fff;
				// border-radius: 50%;
			}

			.title {
				font-size: 16px;
				color: #5E5E5E;
				flex: 1;
				text-align: center;

				.tl {
					color: #000000;
					margin: 1px 0;
				}
			}

			.cont {
				// width: 100px;
				// height: 100px;
				text-align: center;

				.img {
					width: 200px;
					height: 200px;
					text-align: center;
					margin-top: 20px;
				}
			}
		}
	}
</style>